package ca.bcit.comp3910.model;

import java.io.Serializable;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Named;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * 
 * Employee Bean
 * 
 * @author Ivy Cheung, Stacy Mitchell
 * @version 2.0
 * 
 */
@SuppressWarnings("serial")
@Named
@ApplicationScoped
public class Employee implements Serializable {
    /**
     * Employee ID
     */
    @Min(1)
    @Max(999)
    private Integer empID;
    /**
     * Password
     */
    @NotNull
    private String password;
    /**
     * Employee Name
     */
    @NotNull
    private String empName;
    /**
     * Is Admin
     */
    private boolean superUser;
    /**
     * If the variable is editable
     */
    private boolean editable;

    /**
     * Empty constructor
     */
    public Employee() {

    }

    /**
     * Constructor for Super User
     * 
     * @param empID - employee id
     * @param password - password
     * @param empName - employee name
     * @param superUser - admin
     */
    public Employee(int empID, String password, String empName, boolean superUser) {
        this.empID = empID;
        this.password = password;
        this.empName = empName;
        this.superUser = superUser;
    }

    /**
     * Constructor for users Creates dummy data for user 111
     * 
     * @param empID - emp ID
     * @param password - password
     * @param empName - employee name
     */
    public Employee(int empID, String password, String empName) {
        this.empID = empID;
        this.password = password;
        this.empName = empName;
        superUser = false;
    }

    /**
     * Getters and setters
     */
    public Integer getEmpID() { return empID; }
    public void setEmpID(Integer empID) { this.empID = empID; }

    public String getPassword() { return password; }
    public void setPassword(String password) { this.password = password; }

    public String getEmpName() { return empName; }
    public void setEmpName(String empName) { this.empName = empName; }

    public boolean isSuperUser() { return superUser; }
    public void setSuperUser(boolean superUser) { this.superUser = superUser; }

    public boolean isEditable() { return editable; }
    public void setEditable(boolean editable) { this.editable = editable; }

	/*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#toString()
     */
    public String toString() {
        return ("EmpID: " + empID + ", Password: " + password + ", Name: " + empName + ", Admin: " + superUser);
    }
}
